﻿<Window x:Class="TownsAndCountries.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:TownsAndCountries"
        Title="MainWindow" Height="350" Width="525">
    <Window.Resources>
        <local:CountryView x:Key="countryView" ></local:CountryView>
        <local:BinaryImageConverter x:Key="imageConverter"></local:BinaryImageConverter>
    </Window.Resources>
    <StackPanel DataContext="{StaticResource ResourceKey=countryView}">
        
        <Label Name="countryNameLabel" Content="{Binding Source={StaticResource ResourceKey=countryView}, Path=Current.CountryName}"></Label>
        <Label Name="languageNameLabel"  Content="{Binding Source={StaticResource ResourceKey=countryView}, Path=Current.Language}"></Label>
        <Image Width="200" Height="150" Name="flag" Source="{Binding Source={StaticResource ResourceKey=countryView}, Path=Current.Flag,Converter={StaticResource ResourceKey=imageConverter}}"></Image>
        <Button  Width="200"  Name="nextBtn" Content=">>" Click="nextBtn_Click" ></Button>
        <Button Width="200" Name="prevBtn" Content="&lt;&lt;" Click="prevBtn_Click" ></Button>
        
        <Label Name="citiesLabel" Content="{Binding Source={StaticResource ResourceKey=countryView},Path=CurrentCity.CityName}"></Label>
        <Button  Width="200"  Name="nexCityBtn" Content=">>" Click="nextCityBtn_Click" ></Button>
        <Button Width="200" Name="prevCityBtn" Content="&lt;&lt;" Click="prevCityBtn_Click" ></Button>

    </StackPanel>
</Window>
